-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BI-4975: Construct file-connector s3 path dynamically #31
Conversation
e1b1fcf
to
23b2d1e
Compare
lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3_tests/db/base/api/connection.py
Outdated
Show resolved
Hide resolved
lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3_tests/db/conftest.py
Outdated
Show resolved
Hide resolved
def get_full_s3_filename(self, s3_filename_suffix: Optional[str]) -> Optional[str]: | ||
if s3_filename_suffix is None: | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Optional
(both in arguments and in return type)? I can't see any calls where either can be None (except for tests)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now s3_filename_suffix
will be loaded as None
for old connections until migration.
After migration Optional
should be removed (with this fallback
datalens-backend/lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3/chs3_base/core/data_source.py
Lines 120 to 124 in 23b2d1e
if origin_src.s3_filename_suffix is not None: | |
s3_filename = self.connection.get_full_s3_filename(origin_src.s3_filename_suffix) | |
else: | |
# TODO: Remove this fallback after old connections migration to s3_filename_suffix | |
s3_filename = origin_src.s3_filename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly, it is tested against being None here in the line 120 before the get_full_s3_filename
call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, you are right, I can remove Optionals from the method. But actually it's just a copy of old property src.s3_filename
signature that can be None if save task haven't succeeded yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder for all of us, that this check will have to be moved above the fallback after the latter is removed
datalens-backend/lib/dl_connector_bundle_chs3/dl_connector_bundle_chs3/chs3_base/core/data_source.py
Lines 124 to 125 in ad03ba8
if status != FileProcessingStatus.ready or raw_schema is None or s3_filename is None: | |
raise exc.MaterializationNotFinished |
23b2d1e
to
ef3cd86
Compare
No description provided.